CC = g++
#FLAGS = -O4 -DNDEBUG -DISUNIX -static-libgcc -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5
FLAGS = -O4 -DISUNIX -DNDEBUG 
LIB = -lm 
objects = data.o impsamp.o model.o optimise.o process.o Leaphy.o tools.o tree.o bionj.o treelist.o interface.o new_process.o parsimony.o
FILES = data.cxx impsamp.cxx model.cxx optimise.cxx process.cxx Leaphy.cxx tools.cxx tree.cxx interface.cxx treelist.cxx new_process.cxx parsimony.cxx

all : $(objects) Leaphy

Leaphy : $(objects)
	 $(CC) $(FLAGS) -o Leaphy $(objects) $(LIB)
model.o : $(FILES)
	 $(CC) $(FLAGS) -c model.cxx
data.o : data.cxx tools.h
	 $(CC) $(FLAGS) -c data.cxx 
impsamp.o : $(FILES)
	 $(CC) $(FLAGS) -c impsamp.cxx
optimise.o : $(FILES)
	 $(CC) $(FLAGS) -c optimise.cxx
parsimony.o : $(FILES)
	$(CC) $(FLAGS) -c parsimony.cxx
process.o : $(FILES)
	 $(CC) $(FLAGS) -c process.cxx
Leaphy.o : $(FILES)
	 $(CC) $(FLAGS) -c Leaphy.cxx 
tools.o : $(FILES)
	 $(CC) $(FLAGS) -c tools.cxx
tree.o :  $(FILES)
	 $(CC) $(FLAGS) -c tree.cxx 
bionj.o: $(FILES)
	$(CC) $(FLAGS) -c bionj.cxx
treelist.o: $(FILES)
	$(CC) $(FLAGS) -c treelist.cxx
interface.o: $(FILES)
	$(CC) $(FLAGS) -c interface.cxx
new_process.o: $(FILES)
	$(CC) $(FLAGS) -c new_process.cxx
clean :
	rm -f Leaphy $(objects)
